# -*- coding: utf-8 -*-
"""
命令行主入口
"""

import argparse
import sys
from pathlib import Path

try:
    from dotenv import load_dotenv
except Exception:
    def load_dotenv(*args, **kwargs):
        return False


def main():
    """主入口函数"""
    # 加载.env
    try:
        load_dotenv()
    except Exception:
        pass

    # 简化版参数解析
    parser = argparse.ArgumentParser(description="Generate videos from Markdown")
    parser.add_argument("input_path", help="Input file (Markdown or JSON)")
    parser.add_argument("--outdir", default="outputs", help="Output directory")
    parser.add_argument("--no-manim", action="store_true", help="Skip Manim rendering")
    parser.add_argument("--overwrite", action="store_true", help="Overwrite existing files")
    parser.add_argument("--embed-subtitles", action="store_true", help="Embed subtitles")
    parser.add_argument("--use-llm-scenes", action="store_true", help="Use LLM to generate scenes")
    parser.add_argument("--use-llm-manim", action="store_true", help="Use LLM to generate Manim scripts")
    parser.add_argument("--provider", default="none", help="LLM provider")
    parser.add_argument("--model", default="", help="LLM model")
    parser.add_argument("--cache", action="store_true", help="Enable caching")
    parser.add_argument("--config", default="", help="Config file path")

    args = parser.parse_args()

    # TODO: 使用新的模块化架构
    print("Using new modular architecture (in development)")
    print(f"Input: {args.input_path}")
    print(f"Output: {args.outdir}")

    # 这里将来会调用新的流水线
    sys.exit(0)


if __name__ == "__main__":
    main()
